package com.mosai.alignpro.entity;

import com.mosai.alignpro.util.Utils;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Rays on 2020/3/9.
 */
public class Angle {
    private List<Point> points = new ArrayList<>(4);
    private double angle;
    private RemoveAngleInfo removeAngleInfo;
    private boolean isCustom;
    private boolean isTemp;

    public List<Point> getPoints() {
        return points;
    }

    public double getAngle() {
        return angle;
    }

    public void add(Point point) {
        points.add(point);
    }

    public void calculateAngle() {
        if (points.size() < 4) {
            angle = 0;
        } else {
            angle = Utils.calculateLineAngle(points, 0);
        }
    }

    public RemoveAngleInfo getRemoveAngleInfo() {
        return removeAngleInfo;
    }

    public void setRemoveAngleInfo(RemoveAngleInfo removeAngleInfo) {
        this.removeAngleInfo = removeAngleInfo;
    }

    public boolean isCustom() {
        return isCustom;
    }

    public void setCustom(boolean custom) {
        isCustom = custom;
    }

    public boolean isTemp() {
        return isTemp;
    }

    public void setTemp(boolean temp) {
        isTemp = temp;
    }
}
